home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / ARCHIVE / UC2INS.ZIP;1 / U2_EXARC.BAT < prev    next >
Encoding:
DOS Batch File  |  1994-01-01  |  1.8 KB  |  100 lines

  1. @echo off
  2. echo off
  3. rem (C) Copyright 1993, Ad Infinitum Programs, all rights reserved
  4.  
  5. rem U2_EXARC.BAT accepts a single parameter: an archive file. It
  6. rem decompresses all files (including hidden ones, etc.) of this archive
  7. rem completely into the current directory. If nothing goes wrong, the files
  8. rem U$~CHK1 and U$~CHK2 are created by this batch file. UC tests for the
  9. rem presence of those files.
  10.  
  11. rem 1. ARC
  12. rem 2. PK(X)ARC
  13. rem 3. PAK
  14.  
  15. rem ***  ARC  ***
  16.  
  17.    rem Add file to archive
  18.  
  19.       echo check > u$~chk1
  20.       arc a %1 u$~chk1
  21.       del u$~chk1
  22.  
  23.    rem Expand archive
  24.  
  25.       arc xzw %1 *.*/h/a
  26.  
  27.    rem Test for correct expansion
  28.  
  29.       if errorlevel 1 goto error
  30.       if not exist u$~chk1 goto retry1
  31.       goto ok
  32.  
  33.  
  34. :retry1
  35. rem ***  PK(X)ARC  ***
  36.  
  37.    rem Add file to archive
  38.  
  39.       echo check > u$~chk1
  40.       pkarc a %1 u$~chk1
  41.       del u$~chk1
  42.  
  43.    rem Expand archive
  44.  
  45.       pkxarc %1 *.*
  46.  
  47.    rem Test for correct expansion
  48.  
  49.       if errorlevel 1 goto error
  50.       if not exist u$~chk1 goto retry2
  51.       goto ok
  52.  
  53.  
  54. :retry2
  55. rem Handle unlikely case of pkarc being present and pkxarc not
  56.  
  57.     pkarc d %1 u$~chk1
  58.  
  59. rem ***  PAK  ***
  60.  
  61.    rem Add file to archive
  62.  
  63.       echo check > u$~chk1
  64.       pak a %1 u$~chk1
  65.       del u$~chk1
  66.  
  67.    rem Expand archive
  68.  
  69.       pak e %1
  70.  
  71.    rem Test for correct expansion
  72.  
  73.       if errorlevel 1 goto error
  74.       if not exist u$~chk1 goto error
  75.       goto ok
  76.  
  77.  
  78. :error
  79. rem *** Error handling ***
  80.  
  81.    if exist u$~chk1 del u$~chk1
  82.    if exist u$~chk2 del u$~chk2
  83.    goto end
  84.  
  85.  
  86. :ok
  87. rem *** Expansion was successfull ***
  88.  
  89.    rem Call 'extra' file, allowing e.g. addition of banners
  90.  
  91.       command /cu2_xtra
  92.  
  93.    rem Create second check file to notify complete success to UC
  94.  
  95.       echo check > u$~chk2
  96.  
  97.  
  98. :end
  99. rem *** End of batchfile ***
  100.